<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>点击切换登录方式</title>
</head>
<body>
<div id="app">
    <button @click="isUsername = !isUsername">切换</button>

    <!--登录方式一、使用用户名和密码登录-->
    <div v-if="isUsername">
        <form action="">
            <label for="username">
                用户名
            </label>
            <input type="text" name="username" id="username" autocomplete="off">

            <label for="password">密码</label>
            <input type="password" name="password" id="password" autocomplete="off">
        </form>
    </div>
    <!--登录方式二、手机号和验证码登录-->
    <div v-else>
        <form action="">
            <label for="phonenumber">
                手机号
            </label>
            <input type="text" name="phonenumber" id="phonenumber" autocomplete="off">

            <label for="code">验证码</label>
            <input type="text" name="code" id="code" autocomplete="off">
        </form>
    </div>
</div>

<script type="module">
    import {createApp, ref} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                let isUsername = ref(true)
                return {
                    isUsername
                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>